package com.kaifamiao.demo.d0717;

public class Demo01 {

    public static void main(String[] args) {
        System.out.println("6 & 2 = " + (6 & 2));
        System.out.println("6 | 5 = " + (6 | 5));
        System.out.println("6 ^ 5 = " + (6 ^ 5));
        System.out.println("~6  = " + (~6));
        // 在不越界的情况下， a << b = a * 2^b
        System.out.println("6 << 2 = " + (6 << 2));
        System.out.println("-6 << 2 = " + (-6 << 2));
        // 6 % 4 = 6 & (4 - 1) = 2

//        6 & 3 = 6 % 4
    }
}
